//
//  redpacketinfoCell.m
//  WZEfengAndEtong
//
//  Created by 李旭 on 16/9/27.
//  Copyright © 2016年 wanzhao. All rights reserved.
//

#import "redpacketinfoCell.h"
#import "UIImageView+WebCache.h"
#import "UIUtil.h"
#import "CXmppRequestMgr.h"
@interface redpacketinfoCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@property (weak, nonatomic) IBOutlet UIImageView *goodluckImageView;

@end
@implementation redpacketinfoCell
-(void)setRedInfo:(RedPacketInfo *)redInfo
{
    _redInfo = redInfo;
    _headImageView.layer.cornerRadius = 20;
    _headImageView.layer.masksToBounds = YES;
    [_headImageView sd_setImageWithURL:[NSURL URLWithString:[[CXmppRequestMgr shareInstance] DownHeadFileWithContact:redInfo.userId]] placeholderImage:[UIImage imageNamed:@"testHeader"]];
    _nameLabel.text = redInfo.userName;
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:[redInfo.time doubleValue] / 1000.0];
    NSString *str2 = [UIUtil timeForMessageStyle:date];
    _timeLabel.text = str2;
    _moneyLabel.text = [NSString stringWithFormat:@"%.2f元",redInfo.money];
}
-(void)setShowGoodLuck:(BOOL)showGoodLuck
{
    self.goodluckImageView.hidden = !showGoodLuck;
}
- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
